CREATE TABLE [dbo].[UserRole]
(
[UserKey] [uniqueidentifier] NOT NULL,
[RoleKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UserRole] ADD CONSTRAINT [PK_UserRole] PRIMARY KEY CLUSTERED ([UserKey], [RoleKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UserRole] ADD CONSTRAINT [FK_UserRole_RoleMain] FOREIGN KEY ([RoleKey]) REFERENCES [dbo].[RoleMain] ([RoleKey])
GO
ALTER TABLE [dbo].[UserRole] ADD CONSTRAINT [FK_UserRole_UserMain] FOREIGN KEY ([UserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
GRANT SELECT ON [dbo].[UserRole] TO [IMIS]
GO